﻿using System;
using System.Collections.Generic;
using System.Linq;
using Terraria.Localization;

namespace Terraria.ModLoader.Exceptions
{
	// Token: 0x020002F1 RID: 753
	public class MissingResourceException : Exception
	{
		// Token: 0x170001DE RID: 478
		// (get) Token: 0x06001D0C RID: 7436 RVA: 0x000149B9 File Offset: 0x00012BB9
		public override string HelpLink
		{
			get
			{
				return "https://github.com/blushiemagic/tModLoader/wiki/Basic-tModLoader-Modding-FAQ#terrariamodloadermodgettexturestring-name-error";
			}
		}

		// Token: 0x06001D0D RID: 7437 RVA: 0x0001499E File Offset: 0x00012B9E
		public MissingResourceException()
		{
		}

		// Token: 0x06001D0E RID: 7438 RVA: 0x000149A6 File Offset: 0x00012BA6
		public MissingResourceException(string message) : base(message)
		{
		}

		// Token: 0x06001D0F RID: 7439 RVA: 0x000149AF File Offset: 0x00012BAF
		public MissingResourceException(string message, Exception inner) : base(message, inner)
		{
		}

		// Token: 0x06001D10 RID: 7440 RVA: 0x000149C0 File Offset: 0x00012BC0
		public MissingResourceException(string message, ICollection<string> keys) : this(MissingResourceException.ProcessMessage(message, keys))
		{
		}

		// Token: 0x06001D11 RID: 7441 RVA: 0x00437FB0 File Offset: 0x004361B0
		public static string ProcessMessage(string message, ICollection<string> keys)
		{
			string text = LevenshteinDistance.FolderAwareEditDistance(message, keys.ToArray<string>());
			if (text != null && text != "")
			{
				return Language.GetTextValue("tModLoader.LoadErrorResourceNotFoundPathHint", message, text) + "\n";
			}
			return message;
		}
	}
}
